function setCookie(name, value, day) {
    let oDate = new Date()
    oDate.setDate(oDate.getDate() + day)

    document.cookie = `${name}=${value}; expires=${oDate}`
}

function getCookie(name) {
    let arr = document.cookie.split('; ')
    let obj = {}
    for (let i = 0; i < arr.length; i++) {
        let arr2 = arr[i].split('=')

        obj[arr2[0]] = arr2[1]
    }

    return obj[name]
}

function removeCookie(name) {
    setCookie(name, 1, -1)
}